<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script type="module">
	// 执行器函数接收两个参数，两个参数的类型为函数
	// 状态只允许从pending变为fulfilled
	//    resolve
	// 状态只允许从pending变为rejected
	//    reject
	//    抛出异常
	import Promise from "./index.js";
	// state result
	const p = new Promise(function(resolve,reject){
		// 执行器函数
		// resolve(100);// 将状态从pending转为fulfilled,成功值为100
		// reject(300);// 将状态从pending转为rejected,失败的值为300
		throw "异常"
	});
	console.log(p);
</script>
</html>